<?php
 global $woo_options , $current_user;
 session_start();
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>

<head>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php woo_title(''); ?></title>
<?php woo_meta(); ?>
<link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo( 'stylesheet_url' ); ?>" media="screen" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!-- <link rel="stylesheet" type="text/css" href="<?php //echo get_template_directory_uri()?>/css/bootstrap.min.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php //echo get_template_directory_uri()?>/css/font-awesome.min.css" media="screen" /> -->
<?php
	wp_head();
	woo_head();
?>

<?php
 /*==============Show pop up banner home================================================================================================*/
if(is_home()){ 
$argss= array(
		'post_type' => 'pop-up-banner',
		'orderby' => 'date',
		'posts_per_page' =>1,
		'status' => array('publish','private')
		); 
		$the_query = new WP_Query($argss);
		while ( $the_query->have_posts() ) :   $the_query->the_post(); 
		list($thumb) = wp_get_attachment_image_src(get_post_thumbnail_id(),"full");
		(int)$link_pop=get_post_meta($post->ID,"link-pop-up",true)."000";
		$check_hide=get_post_meta($post->ID,"show-hide",true);
		if($check_hide=="on")
		{?>
        	<a  class="fancybox-ad hide" href="<?php echo $thumb ?>"></a>
        <?php } endwhile;wp_reset_query()?>  
<script>
    function pop_up(){$('.fancybox-ad').click();}
	jQuery(function($){
		 $('.fancybox-ad').fancybox();
		 setTimeout('pop_up()',<?php echo $link_pop ?>);	
	})
</script>
<?php }  
/*==============Show pop up banner home===================================================================================================*/
 ?>
</head>

<body <?php body_class(); ?>>
<div id="menu-top">
    <div class="container">
        <div class="top-nav nav">
            <div class="navbar">
                <?php wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav', 'theme_location' => 'top-menu' ) );?>
            </div>
            
            <?php  
			 //////// get wishlist
			 $count_list_like=get_user_meta($current_user->data->ID,"list-like-post",true);
			 if($count_list_like=="") $count_list_like=0;
			 else $count_list_like=count($count_list_like); ?>
      		<div class="pull-right">
            	<ul class="cform-login">
                	<?php if(!is_user_logged_in()) {?>
                    <li class="fl"><a href="<?php echo get_permalink(get_page_id('wish-list')) ?>">Danh sách yêu thích | </a></li>
                	<li class="fl"><a href="<?php echo get_permalink(get_page_id('account-info')) ?>">Tài khoản | </a></li>
                    <li class="fl"><a href="<?php echo get_permalink(get_page_id('dang-ky-thanh-toan')) ?>">Đăng nhập</a></li>
                    <?php } else { ?>
                    <li class="fl"><a href="<?php echo get_permalink(get_page_id('wish-list')) ?>">Danh sách yêu thích (<?php echo $count_list_like; ?>) | </a></li>
                    <li class="fl"><a href="<?php echo get_permalink(get_page_id('account-info')) ?>">Tài khoản | </a></li>
                    <li class="fl"><a href="<?php echo wp_logout_url(home_url());?>">Đăng xuất</a></li>
                    <?php } ?>
                </ul>
            </div>	
            <div class="clearfix"></div>
        </div>
    </div>
</div>


<div class="container">
    <div id="header">
        <div class="row-fluid">
            <div id="logo" class="span3">
                <a href="<?php echo home_url()?>">
                <img src="<?php echo get_template_directory_uri();?>/images/logo.png" />
                </a>
            </div>
            
            <div class="span9 head-tool">
                <div class="row-fluid">
                    <div class="span6">
                        <?php get_search_form();?>
                    </div>
                    
                    <div class="span3 hotline">
                       <div class="row-fluid">
                            <div class="span4 phone-icon"></div>
                            <div class="span8 hotline-show">
                                <div class="hotline-name">Tư vấn bán hàng</div>
                                <div class="hotline-number">0909 335 035</div>
                            </div>
                       </div>
                    </div>
                    
                    <div class="span3 boxcart">
                        <div class="row-fluid">
                            <div class="span4 cart-icon"><a href="#">&nbsp;</a></div>
                            <div class="span8 cart-show">
                                <a href="<?php echo get_permalink(get_page_id("order-cart"));?>">
                                    <div class="cart-name">Giỏ hàng</div>
                                    <div class="cart-number">
                                    <?php if(cart_empty()){?>
                                    (chưa có sản phẩm)
                                    <?php }else{ ?>
                                    ( có <?php echo get_total_cart(); ?> sản phẩm )
                                    <?php } ?>
                                    </div>
                                </a>
                            </div>
                       </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div id="main-menu" class="navbar navbar-inverse">
            <div class="navbar-inner">
                <div class="container">
                
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".collapse-main">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    
                    <!-- Main menu -->
                    <div class="nav-collapse collapse-main collapse">
                        <?php wp_nav_menu( array( 'depth' => 6, 'sort_column' => 'menu_order', 'container' => 'ul', 'menu_id' => 'main-nav', 'menu_class' => 'nav', 'theme_location' => 'primary-menu' ) );?>
                    </div>
                    
					<div id="main-menu">
						<?php show_custom_menu("main2-menu"); ?> 
					</div>
                </div><!--//.containers -->
            </div><!--//.navbar-inner -->
        </div><!--//.navbar -->
        
    </div><!--//#header -->
    <div class="widget_wysija_cont html_wysija"><div id="msg-form-wysija-html5296e5ab999b7-3" class="wysija-msg ajax"></div></div>
    <div class="banner-top">
        <div class="banner-top-title">
          
                <div class="row-fluid">
                    <div class="span3 col1">
                        <span class="tangngay">TẶNG NGAY</span><span class="giatang">100,000đ</span>
                    </div>
                    <div class="span4 col2">KHI ĐĂNG KÝ NHẬN BẢN TIN</div>
                    <div class="span5 col3" style="position:relative;">
                    	<?php echo get_template_part("content","mail-quangcao"); ?>
                    </div>
                </div>
           
        </div>
        
        <div class="banner-top-content">
            <?php show_top_banner();?>
        </div>
    </div>
    
    
    <div id="main-container">


 
    <style>
        .allmsgs .error
        {
            /*display: none !important;*/
        }
    </style>




